package com.zlsy.springbootdemo.memory;

/**
 * @author zhouliang
 * @date 2021/1/21 21:14 Java栈测试
 */
public class JvmStackTest {

  private int num = 0;

  public static void main(String[] args) {
    JvmStackTest jvmStackTest = new JvmStackTest();
    try {
      int i = jvmStackTest.callMe(1, 2);
      System.out.println(i);
    } catch (Throwable e) {
      System.out.println("===========>>>> " + jvmStackTest.num);
      e.printStackTrace();
    }
  }

  private int callMe(int a, int b) {
    num++;
    return callMe(a + b, b);
  }
}
